<template>
    <el-dialog class="queryDialog"  v-bind="$attrs" v-on="$listeners"  width="480px" closed="dialogClose"  :visible.sync="DialogVisible" :close-on-click-modal="false">
          <slot/>
            <span slot="footer" class="dialog-footer">
                <el-button @click="dialogClose" >{{closeText}}</el-button>
                <el-button type="primary" @click="dialogOk" >{{okText}}</el-button>
            </span>
    </el-dialog>
</template>

<script>
export default {
  props: {
    okText: {
      type: String,
      default: '查询'
    },
    closeText: {
      type: String,
      default: '取消'
    },
    query: {
      type: Object,
      default: () => {
        return {}
      }
    }
  },
  watch: {
  },
  data () {
    return {
      DialogVisible: false
    }
  },
  methods: {
    dialogOpen () {
      this.DialogVisible = true
    },
    dialogClose () {
      this.DialogVisible = false
      this.$emit('dialogClose')
    },
    dialogOk () {
      let queryed = this.queryed(this.query)
      this.DialogVisible = false
      this.$emit('dialogOk', queryed)
    }
  }
}
</script>

<style scoped lang="scss">
</style>
